*******************************************************************************
****						Appendix Table G.22 - REGRESSION OF TOTAL TOLL ****
****		ON TIME DIFFERENTIALS: GAS PRICE AND WEATHER ROBUSTNESS		*******
*******************************************************************************
use ".\data\clean\reg_data_covars_031915_v2.dta", clear
drop if weekend==1
*g reliability_diffnew=max(reliability_diff,0)
*replace reliability_diff=reliability_diffnew if reliability_diff!=. 	
replace reliability_diff=0 if reliability_diff<0.01
keep if reliability_diff~=.
la var reliability_diff "Reliability"

*WTP calculation
drop if ELspeed==.
drop if TT_dif_hr==.
drop if holiday==1
la var TT_dif_hr "Time in Hours"
drop if dow==0|dow==6
keep if acct_type=="PRIVATE"&occupancy~="HOV-3"
g highgp=cond(gasprice>4,1,0)


* split samples by high low, gas price, 210W speed,

est sto clear
 xi: reg charged_toll TT_dif_hr  reliability_diff  if inlist(hour,5,6,7,8) & highgp==0, cluster(rt_id)
estimates store a0
xi: reg charged_toll TT_dif_hr  reliability_diff  if inlist(hour,5,6,7,8)  & highgp==1, cluster(rt_id)
estimates store a1
xi: reg charged_toll TT_dif_hr reliability_diff   if inlist(hour,5,6,7,8) & prec==0, cluster(rt_id)
estimates store a2
xi: reg charged_toll TT_dif_hr reliability_diff   if inlist(hour,5,6,7,8) & prec>0, cluster(rt_id)
estimates store a3

esttab  a0 a1 a2 a3  using ".\results\appendix\tabs\ATG22.csv", replace  ///
	cells(b(star fmt(%9.2f)) se(par)) star(* 0.10 ** 0.05 *** 0.01) ///
	stats(r2 N,fmt(%9.3f %9.0g) labels(R-squared N)) ///
		 mtitles("Gas Price <$4" "Gas Price > $4" "Dry" "Rainy") ///
		 nonumbers nodepvars order(_cons TT_dif_hr reliability_diff) label

insheet using ".\results\appendix\tabs\ATG22.csv", comma clear
export excel using ".\results\appendix\AppendixFigsTabs.xlsx", ///
	sheet("Appendix Table G.22", replace)
